<template>
	<view class="my-content">
		<view class="search-box">
			<SearchTab @search="search"></SearchTab>
		</view>
		<view class="bannerMenu  u-flex bgWhite card u-margin-top-30">
			<view @click="toEmailPage">
				<image :src='serverImageUrl("/static/images/getCustomer/ico_yjzs.png")'>
				</image>
				<view>{{$t("邮件助手")}}</view>
			</view>
			<view @click="toEnterprisePage">
				<image :src='serverImageUrl("/static/images/getCustomer/ico_qymd.png")'>
				</image>
				<view>{{$t("收藏企业")}}</view>
			</view>
			<view @click="toTeleSalesPage">
				<image :src='serverImageUrl("/static/images/getCustomer/ico_jwdx.png")'>
				</image>
				<view>{{$t("境外电销")}}</view>
			</view>
		</view>
		<view class="numBox u-flex u-margin-top-30 u-margin-bottom-30">
			<view class="bgWhite ">
				{{$t("新增收藏企业")}}
				<view class="num">100</view>
			</view>
			<view class="bgWhite">
				{{$t("群发邮件数量（封)")}}
				<view class="num">100</view>
			</view>
		</view>
		<view class="title u-margin-bottom-30">
			<view>
				<image :src='serverImageUrl("/static/images/com/customerListByNews/titleIcon.png")'>
				</image>
				{{$t("展会信息")}}
			</view>
			<view class="u-font-28" style="color: #999;" @click="toNewsList">{{$t("更多")}}></view>
		</view>
		<ListByNews :list="newList" @doClick="toInfo"></ListByNews>
	</view>
</template>

<script>
	import SearchTab from '@/components/SearchEnterpriseTab.vue'
	import ListByNews from './components/ListByNews.vue'
	export default {
		components: {
			SearchTab,
			ListByNews
		},
		//下拉刷新 请求展会信息
		onPullDownRefresh() {
			setTimeout(function() {
				uni.stopPullDownRefresh();
			}, 1000);
		},
		data() {
			return {
				newList: []
			};
		},
		methods: {
			toNewsList(){
				this.$u.route({
					url: 'pages/getCustomer/newList/newList',
				})
			},
			toInfo(item) {
				this.$u.route({
					url: 'pages/getCustomer/newInfo/newInfo',
					params: {
						...item
					}
				})
			},
			search(e) {
				this.$u.route({
					url: 'pages/getCustomer/searchResult/searchResult',
					params: e
				})
			},
			toEmailPage() {
				this.$u.route({
					url: 'pages/getCustomer/emailAide/emailAide'
				})
			},
			toEnterprisePage() {

			},
			toTeleSalesPage() {

			},
		}
	}
</script>

<style lang="scss" scoped>
	.my-content {
		background-color: #f6f6f6;
		padding: 20rpx 30rpx;
		height: auto;
		min-height: 100%;

		.title {
			font-size: 30rpx;
			line-height: 50rpx;
			display: flex;
			justify-content: space-between;
			align-items: center;

			image {
				width: 40rpx;
				height: 40rpx;
				vertical-align: middle;
				margin-right: 10rpx;
				transform: translateY(-2px);
			}
		}

		.card {
			border-radius: 15rpx;
			box-shadow: 0rpx 10rpx 20rpx #eee;
		}

		.bgWhite {
			background: #fff;
		}

		.numBox {
			justify-content: space-between;
			align-items: center;

			&>view {
				width: 48%;
				padding: 25rpx;

				.num {
					color: #ff4a17;
					font-size: 40rpx;
					font-weight: bolder;
					margin-top: 10rpx;
				}
			}
		}

		.bannerMenu {
			padding: 45rpx 0;
			justify-content: center;
			font-size: 30rpx;
			color: #333333;
			text-align: center;

			&>view {
				margin: 0 40rpx;
			}

			image {
				width: 80rpx;
				height: 80rpx;
				margin-bottom: 10rpx;
			}
		}
	}
</style>